package com.qf.flash.ui.home.adapter;

import com.qf.flash.R;
import com.qf.flash.model.BalanceBean;
import com.qf.flashlib.adapter.BaseRViewItem;
import com.qf.flashlib.adapter.RViewHolder;

public class CouponDetailsItem extends BaseRViewItem<Object> {
    @Override
    public boolean isItemView(Object entity, int position) {
        return entity instanceof BalanceBean;
    }

    @Override
    public int getItemLayout() {
        return R.layout.item_coupon_details;
    }

    @Override
    public void convert(RViewHolder holder, Object entity, int position, int itemSize) {
        BalanceBean balanceBean = (BalanceBean) entity;
        holder.setText(R.id.tv_title,balanceBean.getContent());
        if(balanceBean.getIsIn().equals("1")){
            holder.setText(R.id.tv_money,"+"+balanceBean.getMoney()+"点");
        }else {
            holder.setText(R.id.tv_money,"-"+balanceBean.getMoney()+"点");
        }
        holder.setText(R.id.tv_time,balanceBean.getCreateDate());
    }
}
